import { BrowserModule } from '@angular/platform-browser';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';

import { AppComponent } from './app.component';
import { FavoriteComponent } from './favorite/favorite.component';
import { TitleCasePipe } from './title-case.pipe';
import { PanelComponent } from './panel/panel.component';
import { LikeComponent } from './like/like.component';
import { CoursesComponent } from './courses/courses.component';
import { ContactFormComponent } from './contact-form/contact-form.component';
import { CourseFormComponent } from './course-form/course-form.component';
import { SigupFormComponent } from './sigup-form/sigup-form.component';
import { SearchFormComponent } from './search-form/search-form.component';
import { ChangePasswordComponent } from './change-password/change-password.component';
import { HttpModule } from '@angular/http';
import { PostsComponent } from './posts/posts.component'; 
import { PostService } from './services/post.service';
import { MyFollowersService } from './services/followers.service';
import { MyFollowersComponent } from './my-followers/my-followers.component';
import { HomeComponent } from './home/home.component';
import { GithubProfileComponent } from './github-profile/github-profile.component';
import { NotFoundComponent } from './not-found/not-found.component';
import { NavbarComponent } from './navbar/navbar.component';

@NgModule({
  declarations: [
    AppComponent,
    FavoriteComponent,
    TitleCasePipe,
    PanelComponent,
    LikeComponent,
    CoursesComponent,
    ContactFormComponent,
    CourseFormComponent,
    SigupFormComponent,
    SearchFormComponent,
    ChangePasswordComponent,
    PostsComponent,
    MyFollowersComponent,
    HomeComponent,
    GithubProfileComponent,
    NotFoundComponent,
    NavbarComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    ReactiveFormsModule,
    HttpModule,
    RouterModule.forRoot([
      {path: '', component: HomeComponent},
      {path: 'followers/:id', component: GithubProfileComponent},
      {path: 'followers', component: MyFollowersComponent},
      {path: 'posts', component: PostsComponent},
      {path: '**', component: NotFoundComponent}
    ])
  ],
  providers: [
    PostService,
    MyFollowersService
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
